package br.com.io.streams;

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class LendoPrimitivos {
	public static void main(String[] args) {
		String ba = File.separator;
		
		try {
			InputStream is = new FileInputStream("stream"+ba+"DataOutPut"+ba+"primitives.data");
			DataInputStream dis = new DataInputStream(is);
			
			boolean v = dis.readBoolean();
			char c = dis.readChar();
			byte b = dis.readByte();
			short s = dis.readShort();
			int i = dis.readInt();
			long l = dis.readLong();
			float f = dis.readFloat();
			double d = dis.readDouble();
			
			System.out.println(v);
			System.out.println(c);
			System.out.println(b);
			System.out.println(s);
			System.out.println(i);
			System.out.println(l);
			System.out.println(f);
			System.out.println(d);
			
			is.close();
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch(IOException e){
			e.printStackTrace();
		}
		
		
	}
}
